using System;
using System.Collections.Generic;
using System.Text;

namespace Slf.Samples.DebugLogging
{
  class Program
  {
    static void Main(string[] args)
    {
      Console.ForegroundColor = ConsoleColor.Green;
      Console.Out.WriteLine("The debug logger does not write to the console but to the output window in Visual Studio.");
      Console.Out.WriteLine("In order to see output, you need to run this sample in debug mode.");
      Console.ResetColor();
      
      //set up DebugLogger
      ILogger logger = new DebugLogger();
      LoggerService.SetLogger(logger);

      //do some work
      DoSomeWork();
      Console.ReadLine();
    }



    private static void DoSomeWork()
    {
      //get the logger via LoggerService
      ILogger logger = LoggerService.GetLogger();

      //log info
      logger.Error("This is an error.");
    }
  }
}